package org.jeecg.modules.logistics.manage.sq_info.controller;

import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import lombok.extern.slf4j.Slf4j;


import org.jeecg.modules.logistics.manage.sq_info.entity.SqInfo;
import org.jeecg.modules.logistics.manage.sq_info.service.ISqInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

import java.util.List;

/**
 * @Description: 社区信息
 * @Author: 唐小尊
 * @Date: 2019-11-21
 * @Version: V1.0
 */
@Slf4j
@Api(tags = "社区信息")
@RestController
@RequestMapping("/my/qzInfo")
public class SqInfoController {
    @Autowired
    private ISqInfoService sqInfoService;

    /**
     * 得到全部帖子信息
     *
     * @return
     */
    @AutoLog(value = "得到全部帖子信息")
    @ApiOperation(value = "得到全部帖子信息", notes = "得到全部帖子信息")
    @GetMapping(value = "/getAllTz")
    public Result<List<SqInfo>> getAllTz() {
        Result<List<SqInfo>> result = new Result<List<SqInfo>>();
        List<SqInfo> sqInfo = sqInfoService.getAllSq();
        result.setResult(sqInfo);
        result.success("查找成功！");
        return result;
    }

    /**
     * 得到一个帖子的信息
     *
     * @return
     */
    @AutoLog(value = "得到一个帖子的信息")
    @ApiOperation(value = "得到一个帖子的信息", notes = "得到一个帖子的信息")
    @GetMapping(value = "/getOneTz")
    public Result<SqInfo> getOneTz(String tzId) {
        Result<SqInfo> result = new Result<SqInfo>();
        SqInfo qzInfos = sqInfoService.getOneSq(tzId);
        result.setResult(qzInfos);
        result.success("查找成功！");
        return result;
    }

}
